-- GENERATED SPELL FOR [Soul Devourer] --


function spell0_20866(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(33958,pUnit)
pUnit:RegisterEvent('Sorts_20866', 8302, 1)
end

function spell1_20866(pUnit, Event) --@Fel Breath,Self--
pUnit:FullCastSpellOnTarget(36654,pUnit)
pUnit:RegisterEvent('Sorts_20866', 584, 1)
end

function spell2_20866(pUnit, Event) --@Fel Breath,Self--
pUnit:FullCastSpellOnTarget(38813,pUnit)
pUnit:RegisterEvent('Sorts_20866', 545, 1)
end

function spell3_20866(pUnit, Event) --@Sightless Eye,Self--
pUnit:FullCastSpellOnTarget(36644,pUnit)
pUnit:RegisterEvent('Sorts_20866', 575, 1)
end

function Sorts_20866(pUnit, Event)
local choix_sorts_20866 = math.random(0, 3)
if choix_sorts_20866 == 0 then
pUnit:RegisterEvent('spell0_20866', 1, 1)
end
if choix_sorts_20866 == 1 then
pUnit:RegisterEvent('spell1_20866', 1, 1)
end
if choix_sorts_20866 == 2 then
pUnit:RegisterEvent('spell2_20866', 1, 1)
end
if choix_sorts_20866 == 3 then
pUnit:RegisterEvent('spell3_20866', 1, 1)
end
end

function mob20866_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20866', math.random(1500, 3000), 1)
end

function mob20866_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20866_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20866_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20866, 1, 'mob20866_Action')
RegisterUnitEvent(20866, 2, 'mob20866_Leave')
RegisterUnitEvent(20866, 3, 'mob20866_Kill')
RegisterUnitEvent(20866, 4, 'mob20866_Die')
